import java.util.HashMap;
import java.util.Scanner;


    public class 统计单词数 {
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            String str = scanner.nextLine().replace(".","");
            str = str.replace(",", "");

            String[] split = str.split("\\s");
            HashMap<String, Integer> map = new HashMap<>();
            // 为每一个单词创建一个map
            for (int i = 0; i < split.length; i++) {
                split[i] = split[i].toLowerCase();
            }
            for (int i = 0; i < split.length; i++) {
                map.put(split[i],0);
            }
            // 输入
            for (int i = 0; i < split.length; i++) {
                map.put(split[i],map.get(split[i])+1);
            }
            int max=0;
            String maxStr=split[0];
            for(int i=1;i<split.length;i++)
            {
                if(split[i].length()>max)
                {
                    max = split[i].length();
                    maxStr = split[i];
                }
            }
            // 输出
            for (int i = 0; i < split.length; i++) {
                if (String.valueOf(map.get(split[i])).equals("null")){
                    continue;
                }
                else {

                    for(int k=0;k<max-split[i].length();k++)
                    {
                        System.out.print(" ");
                    }


                    String sum = "";
                    for (int j = 0; j < map.get(split[i]); j++) {
                        sum = sum +"*";
                    }
                    System.out.println(split[i].toUpperCase()+":"+sum+map.get(split[i]));
                    map.remove(split[i]);

                }
            }
        }

}
